#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#define SIZE 1024

enum 
{
    FLUSH_NONE, 
    FLUSH_LINE,
    FLUSH_FULL
};

struct IO_FILE
{
    int flag;//刷新方式
    int fileno;//文件描述符
    int size;//缓冲区大小
    int cap;
    char outbuffer[SIZE];
};

//using mFile = struct  IO_FILE;
typedef struct IO_FILE mFile;


mFile* myfopen(const char* filename,const char* mode);
int myfwrite(const void* ptr,size_t size,size_t  num,mFile* stream);
void myfflush(mFile* stream);
void myfclose(mFile* stream);


